package com.guigu.xm.yy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.xm.pojo.MApply;
import com.guigu.xm.pojo.PageVo;
import com.guigu.xm.yy.mapper.MApplyMapper;
import com.guigu.xm.yy.service.MApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MApplyServiceImpl  implements MApplyService {
    @Autowired(required = false)
    MApplyMapper mm;
    @Override
    public PageVo<MApply> allJihuaDan(String page, String num) {
        page=page==null?"1":page;
        num=num==null?"3":num;
        PageHelper.startPage(Integer.parseInt(page),Integer.parseInt(num));
        List<MApply> mApplies = mm.allJihuaDan();
        PageInfo pageInfo=new PageInfo(mApplies);
        PageVo pageVo=new PageVo();
        pageVo.setTotal(pageInfo.getTotal());
        pageVo.setRows(mApplies);
        return pageVo ;
    }
}
